package com.board.db.sqlconfig;

import java.io.Reader;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

public final class IBatisDBConnector {
	private static SqlMapClient mySqlMap;
	
	static {
		try {
			String resource = "com/board/db/sqlconfig/MSSqlMapConfig.xml";
			Reader reader = Resources.getResourceAsReader(resource);
			mySqlMap = SqlMapClientBuilder.buildSqlMapClient(reader);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public static SqlMapClient getSqlMapInstance() {
		return mySqlMap;
	}
}
